package com.cd.service.party.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.cd.bean.Party;
import com.cd.dao.PartyMapper;
import com.cd.service.party.PartyService;

/**
 *  党建工作
 *@Author zhk
 *@Date 2018-1-11
 **/
@Service("partyService")
public class PartyServiceImpl implements PartyService{

	@Autowired
	PartyMapper partyMapper;
	
	@Override
	public void save(Party party) throws Exception {
		partyMapper.save(party);
	}

	@Override
	public void delete(Integer id) throws Exception {
		partyMapper.delete(id);
	}

	@Override
	public void edit(Party party) throws Exception {
		partyMapper.update(party);
	}

	@Override
	public List<Party> listAll() throws Exception {
		// TODO Auto-generated method stub
		return partyMapper.queryByList();
	}

	@Override
	public Party findById(Integer id) throws Exception {
		// TODO Auto-generated method stub
		return partyMapper.query(id);
	}

	@Override
	public void deleteAll() throws Exception {
		
	}

	@Override
	public Integer size() throws Exception {
		// TODO Auto-generated method stub
		return partyMapper.getCount();
	}

	@Override
	public List<Party> listLimit() throws Exception {
		// TODO Auto-generated method stub
		return partyMapper.list();
	}

}
